package com.itheima.controller;

import com.itheima.service.mongo.impl.IdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// pid字段自增服务
@RestController
@RequestMapping("/idCreate")
public class IdController {

    @Autowired
    private IdService idService;

    @GetMapping("/getNextId")
    public Long getNextId(String collName) {
        return idService.getNextId(collName);
    }
}